#!/bin/bash
#========================================================================
# Author: YSLin
# Email: 
# File Name: sort.sh
# Description: 
#   
# Edit History: 
#   2011-01-14    File created.
#========================================================================

tr '!?":;\[\]{}(),.\t\n' ' ' < ch15.doc |
tr 'A-Z' 'a-z' | tr -s ' ' | tr ' ' '\n' | sort


tr '!?":;\[\]{}(),.\t\n' ' ' < ch15.doc |
tr 'A-Z' 'a-z' | tr -s ' ' | tr ' ' '\n' | sort | uniq -c |
sort -rn | head


#sort -k start,end files
#Here start is the starting column for the key, and end is the ending column for the key. 
#The first column is 1, the second column is 2, and so on.
sort -rn -k 2,2 switched.txt
